﻿@using BlazorAdmin.Models
@inherits ComponentBase
<div class="tree-menu">
    <TreeView TItem=Navigation Items=InternalItems ShowCheckbox=true ShowIcon=true IsAccordion=true AutoCheckChildren=true AutoCheckParent=true
              OnTreeItemChecked=OnTreeItemChecked />
    <div class="form-footer">
        <div>
            <Button Color="Color.Secondary" Icon="fa-solid fa-xmark" Text="关闭" OnClickWithoutRender="OnClickClose" />
            <Button Color="Color.Primary" Icon="fa-solid fa-check" Text="保存" OnClickWithoutRender="OnClickSave" />
        </div>
    </div>
</div>

@code {
    RenderFragment<Navigation> RenderTreeItem => item =>
    @<div class="d-flex flex-fill">
        <span class="flex-fill">@item.Name</span>
        <span class="ms-3">@item.SortNo</span>
        <span class="app-type">@item.IsResource.ToDescriptionString()</span>
        <span class="app-text">@GetApp(item.Application)</span>
    </div>;
}
